import requests

HEADERS = {
    'User-Agent':
    'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.81 Safari/537.36'
}

URL_PATTERN_DICT = {'wikizh':'https://zh.wikipedia.org/wiki/%s','wikien':'https://en.wikipedia.org/wiki/%s','googlehk':'https://www.google.com.hk/search?q=%s','googleen':'https://www.google.com/search?q=%s'}

def fetchData(somewhat: str, website='wiki',languagetype='zh'):
    resultData = '<h1>oooops!</h1>'
    if website == 'oneurl':
        resultData = requests.get(somewhat,headers=HEADERS).text
    else:
        resultData = requests.get(URL_PATTERN_DICT[website] % somewhat,headers=HEADERS).text
    return resultData
